﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wyn.PMS.Common.NightAudit;

namespace Wyn.PMS.Test.Cache
{
    class PriceCacheTest
    {
        public static void Test(string hotelId)
        {
            CacheMonitor monitor = CacheMonitor.GetInstance();

            PriceCache pc = PriceCache.GetInstance();

            Console.WriteLine("--------基础房价信息--------");

            var prices = pc.ReadonlyPrice.Where(k => k.Value.HotelID == hotelId);

            foreach (var price in prices)
            {
                Console.WriteLine("酒店编号{0} 房型{1} 房价{2}",
                                  price.Value.HotelID,
                                  price.Value.RoomTypeID,
                                  price.Value.NormalPrice);
            }

            Console.WriteLine("--------折扣码信息--------");

            Console.ReadKey();

            var rates= pc.ReadonlyRate.Where(k => k.Value.HotelID == hotelId&&k.Value.CodeTypeID==3);

            foreach (var rate in rates)
            {
                Console.WriteLine("酒店编号{0} 房型{1} 折扣值{2} 折扣方式{3} 折扣种类{4}",
                                  rate.Value.HotelID,
                                  rate.Value.RoomTypeID,
                                  rate.Value.Rate,
                                  rate.Value.RateType,
                                  rate.Value.CodeValue
                                  );

            }

        }
    }
}
